#pragma once

#include <atlbase.h>
#include <atlwin.h>

#include "wmp.h"

class WMPRemoteHost : 
    public CComObjectRootEx<CComSingleThreadModel>,
    public IServiceProvider,
    public IWMPRemoteMediaServices
{
public:
    WMPRemoteHost(){}
    ~WMPRemoteHost(){}

    DECLARE_PROTECT_FINAL_CONSTRUCT()

BEGIN_COM_MAP(WMPRemoteHost)
    COM_INTERFACE_ENTRY(IServiceProvider)
    COM_INTERFACE_ENTRY(IWMPRemoteMediaServices)
END_COM_MAP()

    // IServiceProvider
    STDMETHOD(QueryService)(REFGUID guidService, REFIID riid, void **ppv)
    {
        return QueryInterface(riid, ppv);
    }
    // IWMPRemoteMediaServices
    STDMETHOD(GetServiceType)(BSTR *pbstrType)
    {
        *pbstrType = ::SysAllocString(L"Remote");
        return S_OK;
    }
    STDMETHOD(GetApplicationName)(BSTR *pbstrName)
    {
        *pbstrName = ::SysAllocString(L"MEA");
        return S_OK;
    }
    STDMETHOD(GetScriptableObject)(BSTR * pbstrName, IDispatch ** ppDispatch)
    {
        return E_NOTIMPL;
    }
    STDMETHOD(GetCustomUIMode)(BSTR * pbstrFile)
    {
        return E_NOTIMPL;
    }
	
};